<?php
namespace soa\orders\v1\batch;

use soa\client;

class task extends client{
    /**
     * @var string
     */
    protected $service_url = 'http://order.core.kuaidihelp.com/';

    /**
     * @var string
     */
    protected $service_name = 'kuaidihelp_order2';

    //添加批量订单任务
    public function insert($uid,$platform,$courierId,$shipperInfo,$shippingInfo,$num,$packageInfo = "其他",$packageWeight = 1,$extraInfo = [])
    {
        return $this->post('v1/batch/task/insert', compact('uid','platform','courierId','shipperInfo','shippingInfo','num','packageInfo','packageWeight','extraInfo'));
    }

    //根据快递员id查询
    public function getByCourierId($courierId,$limit = [],$orderBy = "id DESC")
    {
        return $this->post('v1/batch/task/getByCourierId', compact('courierId','limit','orderBy'));
    }

    //根据任务id查询
    public function getByTaskId($taskId)
    {
        return $this->post('v1/batch/task/getByTaskId', compact('taskId'));
    }

    //开始任务
    public function startTask($taskId){
        return $this->post('v1/batch/task/startTask', compact('taskId'));
    }

    //结束任务
    public function finishTask($taskId){
        return $this->post('v1/batch/task/finishTask', compact('taskId'));
    }
}